package com.kgc.storeprovider.controller;


import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.InStoreDetail;
import com.kgc.store.pojo.OutStoreDetail;
import com.kgc.store.remote.InStoreDetailRemote;
import com.kgc.store.remote.OutStoreDetailRemote;
import com.kgc.storeprovider.service.InStoreDetailService;
import com.kgc.storeprovider.service.OutStoreDetailService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OutStoreDetailController implements OutStoreDetailRemote {

    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private OutStoreDetailService outStoreDetailService;


    @Override
    public ResponseMsg getOutStoreDetailList(String outStoreCode) {
        logger.info("OutStoreDetailController getOutStoreDetailList outStoreCode:"+outStoreCode);
        ResponseMsg msg = outStoreDetailService.getOutStoreDetailList(outStoreCode);
        logger.debug("OutStoreDetailController getOutStoreDetailList outStoreCode:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg delOutStoreDetail(Integer id) {
        logger.info("OutStoreDetailController delOutStoreDetail id:"+id);
        ResponseMsg msg = outStoreDetailService.delOutStoreDetail(id);
        logger.debug("OutStoreDetailController delOutStoreDetail msg:"+msg);
        return msg;
    }

    @Override
    public ResponseMsg addOutStoreDetail(OutStoreDetail outStoreDetail) {
        logger.info("OutStoreDetailController addOutStoreDetail outStoreDetail:"+outStoreDetail);
        ResponseMsg msg = outStoreDetailService.addOutStoreDetail(outStoreDetail);
        logger.debug("OutStoreDetailController addOutStoreDetail msg:"+msg);
        return msg;
    }
}

